% $Id: parse_all.m 6 2008-11-01 19:44:41Z Jie.Bao $

clear all;

% user can define the path to the log files, default is the current
% working directory
log_file_path = 'c:\Dokumente und Einstellungen\boggie\Desktop\gregory\';
files = dir([log_file_path 'VP*.xml']);

% global entry counter and the MATLAB structure log are initialized
result.entry_counter = 1;
result.log = struct();

% parse all log files according to the order sorted automatically
for i = 1:length(files)
    disp(['Parsing ''' files(i).name ''' ...']);
    result = parse_xml([log_file_path files(i).name], result);
end

% save as xml file, user can define the name of the merged log file
log = result.log;
xml_write([log_file_path 'test.xml'], log); 
